package com.gzasc.good.controller;

import com.gzasc.good.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("goods")
public class GoodController {
    @Autowired
    private GoodsService goodsService;
    //查询所有商品
    @RequestMapping("all")
    public Object all(){
        return goodsService.findAll();
    }
    //根据id查询商品
    @RequestMapping("one")
    public Object one(Integer id){
        return goodsService.findById(id);
    }
}
